#ifndef __CONSTANTS_H__
#define __CONSTANTS_H__

#define		BUFSIZE				    1024	// maximum length of the string to be parsed
#define		NUM_OF_LEDS             8
#define		SYSTEM_CALL             5

#define     SYNTAX_ERROR			1
#define     UNEXPECTED_ERROR		-1
#define     BINARY					2
#define     OCTAL					8
#define     DECIMAL					10
#define     HEX						16

#define     EOLN					20
#define     COMMENT					21
#define     IDENTIFIER				22
#define     SEMI					23
#define     COLON					24
#define     COMMA					25
#define     LABEL					26

#define     INSTRUCTION				50
#define     DIRECTIVE				51
#define		REGISTER				52

#define		LED_0					1
#define		LED_1					2
#define		LED_2					4
#define		LED_3					8
#define		LED_4					16
#define		LED_5					32
#define		LED_6					64
#define		LED_DOT					128

#define		DISPLAY_r				48

/*
#define     DATA_TRANSFER   51
#define     ARITHMETIC      52
#define     LOGICAL         53
#define     BRANCHING       54
#define     CONTROL         55
*/

#define   MOV_START               0x40
#define   MVI_START               0x06
#define   LDAX_START              0x0A
#define   LHLD_START              0x2A
#define   LDA_START               0x3A
#define   STAX_START              0x02
#define   SHLD_START              0x22
#define   STA_START               0x32
#define   LXI_START               0x01
#define   SPHL_START              0xF9
#define   XTHL_START              0xE3
#define   XCHG_START              0xEB
#define   OUT_START               0xD3
#define   IN_START                0xDB
#define   PUSH_START              0xC5
#define   POP_START               0xC1

#define   ADD_START               0x80
#define   ADC_START               0x88
#define   ADI_START               0xC6
#define   ACI_START               0xCE
#define   SUB_START               0x90
#define   SBB_START               0x98
#define   SUI_START               0xD6
#define   SBI_START               0xDE
#define   DAD_START               0x09
#define   DAA_START               0x27
#define   INR_START               0x04
#define   INX_START               0x03
#define   DCR_START               0x05
#define   DCX_START               0x0B

#define   STC_START               0x37
#define   ANA_START               0xA0
#define   ANI_START               0xE6
#define   XRA_START               0xA8
#define   XRI_START               0xEE
#define   ORA_START               0xB0
#define   ORI_START               0xF6
#define   CMP_START               0xB8
#define   CPI_START               0xFE
#define   RLC_START               0x07
#define   RRC_START               0x0F
#define   RAL_START               0x17
#define   RAR_START               0x1F
#define   CMA_START               0x2F
#define   CMC_START               0x3F

#define   JMP_START               0xC3
#define   JNZ_START               0xC2
#define   JZ_START                0xCA
#define   JNC_START               0xD2
#define   JC_START                0xDA
#define   JPO_START               0xE2
#define   JPE_START               0xEA
#define   JP_START                0xF2
#define   JM_START                0xFA
#define   PCHL_START              0xE9
#define   RST_START               0xC7
#define   CALL_START              0xCD

#define   CNZ_START               0xC4
#define   CZ_START                0xCC
#define   CNC_START               0xD4
#define   CC_START                0xDC
#define   CPO_START               0xE4
#define   CPE_START               0xEC
#define   CP_START                0xF4
#define   CM_START                0xFC

#define   RET_START               0xC9
#define   RNZ_START               0xC0
#define   RZ_START                0xC8
#define   RNC_START               0xD0
#define   RC_START                0xD8
#define   RPO_START               0xE0
#define   RPE_START               0xE8
#define   RP_START                0xF0
#define   RM_START                0xF8

#define   NOP_START               0x00
#define   HLT_START               0x76
#define   DI_START                0xF3
#define   EI_START                0xFB
#define   RIM_START               0x20
#define   SIM_START               0x30

#endif